# -*- coding: utf-8 -*-
# @Time    : 2019/11/8 18:00
# @Author  : Jinwei
# @File    : main.py

'''主程序文件，运行它就可以开启整个流程'''

from testcase.testcase_unittest import *
from config.config import reportpath
from HTMLTestRunner import HTMLTestRunner



def StartMain():
    # 构造测试套件
    suite = unittest.TestSuite()
    # 在测试套件中加入指定要运行的测试用例
    suite.addTest(startCase("testcase"))
    # 定义测试报告
    title = "Appium自动化测试报告"
    description = "相关用例执行情况"
    with open(reportpath, 'wb') as file_result:
        runner = HTMLTestRunner(stream=file_result, title=title, description=description)
        # 运行测试用例
        runner.run(suite)



if __name__ == '__main__':
    StartMain()
